/*
 * DxfReader.java
 *
 * Created on 4 de Dezembro de 2007, 9:35
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package importadorDXF;

/**
 *
 * @author rafaelbuck
 */
public class DxfReader implements DxfReporter
{    
    private int nrWarnings;
    private DxfFile dxfFile;
    
    /** Creates a new instance of DxfReader */
    public DxfReader(String path)
    {
        // Tenta ler o arquivo passado como parametro
        try
        {
            dxfFile = new DxfFile(path, this);            
            System.out.println("OK: " + path + " (" + nrWarnings + " warnings)");
        }
        catch(Exception x)
        {
            System.err.println(x);
            System.out.println("WRONG: " + path + " (" + nrWarnings + " warnings)");
        }
    }

    // Imprime warnings
    @Override
    public void showWarning(String msg)
    {
        nrWarnings++;
        System.out.println(msg);
    }   
    
    @Override
    public void showStatus(String s){}

    @Override
    public void showStatusRes(String s){}

    @Override
    public void showStatusRes(String s, String as[]){}

    @Override
    public void showWarningRes(String s){}

    @Override
    public void showWarningRes(String s, String as[]){}
    
    @Override
    public void showProgress(){}

    @Override
    public void showProgress(float f){}

    @Override
    public void showProgress(float f, float f1){}

    @Override
    public void showProgress(long l, long l1){}

    /**
     * @return the dxfFile
     */
    public DxfFile getDxfFile() {
        return dxfFile;
    }

    /**
     * @param dxfFile the dxfFile to set
     */
    public void setDxfFile(DxfFile dxfFile) {
        this.dxfFile = dxfFile;
    }
    
//    public static void main(String[] args) 
//    {
//        new DxfReader("yate01.dxf");
//    }      
}